#!/usr/bin/python3
# -- coding: utf-8 --
#@Author : github@raindrop https://github.com/raindrop-hb/tencent-video
# @Time : 2023/3/31 10:23
# -------------------------------
# cron "30 0,1,2 * * *" script-path=xxx.py,tag=匹配cron用
# const $ = new Env('网易云签到');
import os

import requests
from commit import *

#抓取网易音乐 https://music.163.com/
# export cook=''


cook = os.getenv("CloudMusic")

def music_test():
    try:
        list=["http://music.163.com/api/point/dailyTask?type=0","http://music.163.com/api/point/dailyTask?type=1"]
        head={
            "Pragma": "no-cache",
            "DNT": "1",
            "Accept-Encoding": "gzip, deflate, sdch",
            "Accept-Language": "en,zh-CN;q=0.8,zh;q=0.6",
            "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.30 Safari/537.36",
            "Content-Type": "application/x-www-form-urlencoded",
            "Accept": "*/*",
            "Cache-Control": "no-cache",
            "Referer": "http://music.163.com/discover",
            "Cookie": cook,
            "Connection": "keep-alive"
        }
        for i in list:
            try:
                r = requests.get(url=i,headers=head).json()

                regular_mui("msg",r)
            except:
                pass
    except Exception:
        print("网易云签到报错")


if __name__ == '__main__':
    music_test()


